<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>部门信息</title>
</head>
<style type="text/css">
    table {border-collapse: collapse; font-size: 14px; width: 80%; margin: auto}
    table, th, td {border: 1px solid darkslategray;padding: 10px}
</style>
<body>

<div style="text-align: center">
    <span style="color: darkslategray; font-size: 30px">欢迎光临！</span>
    <button><a th:href="@{/department/toadd}">添加</a> </button>
    <button><a th:href="@{/employee/findEmployee}">员工管理</a> </button>
    <button><a th:href="@{/post/findPost}">职务管理</a> </button>
    <hr/>
    <table class="list">
        <tr>
            <th>did</th>
            <th>部门名称</th>
            <th>建立时间</th>
            <th>操作</th>
        </tr>
        <tr th:each="user : ${department}">
            <td th:text="${user.did}"></td>
            <td th:text="${user.dname}"></td>
            <td th:text="${#dates.format(user.getCreatetime(),'yyyy-MM-dd')}"></td>
            <td><a th:href="@{/department/toupdate(id=${user.did})}">修改</a>
                <a th:href="@{/department/delDepartment(id=${user.did})}">删除</a>
            </td>
        </tr>
    </table>
</div>
</body>
</html>